<template>
  <van-nav-bar
      fixed
      title="文章详情"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
  />
  <van-cell>文章标题</van-cell>
  <van-cell class="title">{{detail.title}}</van-cell>
  <div class="content">{{detail.content}}</div>
</template>

<script>
import {articleDetail} from "@/api/article";

export default {
  name: "ArticleDetail",
  data(){
    return {
      detail:{},
    }
  },
  created() {
    var id = this.$route.query.id;
    articleDetail(id).then((res)=>{
      this.detail = res.data
    })
  },
  methods:{
    onClickLeft(){
      history.back()
    },
  }

}
</script>

<style scoped>
  .title{
    font-size: 20px;
  }
  .content{
    margin-top: 30px;
    background-color: #fafafa;
    width: 90%;
    float: left;
    margin-left: 5%;
  }
</style>
